package com.base.cn.platform.os.controller.qa;

import com.base.cn.platform.os.common.utils.result.ResultUtil;
import com.base.cn.platform.os.controller.cmmon.ApiBaseController;
import com.base.cn.platform.os.service.course.qa.qatype.QaTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 问答类型接口
 *
 * @author s.li
 * @create 2018-09-06-19:52
 */
@RestController
@RequestMapping("/api/qa")
public class ApiQaTypeController extends ApiBaseController {

    @Autowired
    private QaTypeService qaTypeService;

    /**
     * 查询问答类型列表
     * @return Map<String,Object>
     */
    @RequestMapping("/queryQaTypeList")
    public Map<String,Object> queryQaTypeList(){
        Map<String,Object> params = new HashMap<>();
        params.put("status",1);
        List<Map<String,Object>> typeList = qaTypeService.queryQaTypeList(params);
        return ResultUtil.SUCCESS(typeList);
    }
}
